package com.role{
	/**
	 * 创建者：薛恒杰
	 * 工程名称：Marbles
	 * 创建时间：Jul 30, 2012 12:04:28 PM
	 * 类说明：Soldier.as,士兵类
	 */
	import com.collection.ConfigCollection;
	import com.utils.Collide;
	
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.filters.ColorMatrixFilter;
	import flash.geom.Point;
	
	public class Soldier extends MoveBase{
		public function Soldier(life:int, attack:int, defense:int, quality:Number, radius:int = 10, vScale:Number = 1, acceleration:Number = -.1, bounce:Number = -.1)
		{
			super(life, attack, defense, quality, radius, vScale, acceleration, bounce);
			_position = new Point();
			selected(false);
			_collide = new Collide(quality, attack);
		}
		/**
		 * 设置士兵颜色，以后使用图形元素后改为高亮方式
		 * @param value true为选中(红色)，false为绿色。
		 */
		public function selected(value:Boolean):void{
			bitmap.filters = value?[new ColorMatrixFilter([
				1,0,0,0,85,
				0,1,0,0,0,
				0,0,1,0,0,
				0,0,0,1,0])]:null;
			buttonMode = value;
		}
		/**
		* 获取即时碰撞系数。
		*/
//		override public function get collide():Collide{
//			_collide.speed = runSpeed;
//			_collide.angle = angle;
//			return _collide;
//		}
		/**
		 * 承受一个外来碰撞系数。
		 */
//		override public function setcollide(value:Collide):void{
//			//这里把新给进来的碰撞系数进行运算
//		}
	}
}